package com.shop.entity;

import java.io.Serializable;
import java.util.Objects;

//用户表
public class User implements Serializable {


    private int u_id; //用户唯一id
    private String u_name; //用户名
    private String u_pwd; //用户密码
    private int u_authority; //用户权限
    private int u_age; //用户年龄
    private String u_sex; //用户性别
    private String u_location; //用户地址（可以为空但是购物前必须填写）
    private String u_img;
    private String u_introduction; //用户个人介绍

    public User(int u_id, String u_name, String u_pwd, int u_authority, int u_age, String u_sex,
                String u_location, String u_img, String u_introduction) {
        this.u_id = u_id;
        this.u_name = u_name;
        this.u_pwd = u_pwd;
        this.u_authority = u_authority;
        this.u_age = u_age;
        this.u_sex = u_sex;
        this.u_location = u_location;
        this.u_img = u_img;
        this.u_introduction = u_introduction;
    }


    public User(String u_name, int u_age, String u_sex, String u_location, String u_introduction) {
        this.u_name = u_name;
        this.u_age = u_age;
        this.u_sex = u_sex;
        this.u_location = u_location;
        this.u_introduction = u_introduction;
    }

    public int getU_id() {
        return u_id;
    }

    public void setU_id(int u_id) {
        this.u_id = u_id;
    }

    public String getU_name() {
        return u_name;
    }

    public void setU_name(String u_name) {
        this.u_name = u_name;
    }

    public String getU_pwd() {
        return u_pwd;
    }

    public void setU_pwd(String u_pwd) {
        this.u_pwd = u_pwd;
    }

    public int getU_authority() {
        return u_authority;
    }

    public void setU_authority(int u_authority) {
        this.u_authority = u_authority;
    }

    public int getU_age() {
        return u_age;
    }

    public void setU_age(int u_age) {
        this.u_age = u_age;
    }

    public String getU_sex() {
        return u_sex;
    }

    public void setU_sex(String u_sex) {
        this.u_sex = u_sex;
    }

    public String getU_location() {
        return u_location;
    }

    public void setU_location(String u_location) {
        this.u_location = u_location;
    }

    public String getU_img() {
        return u_img;
    }

    public void setU_img(String u_img) {
        this.u_img = u_img;
    }

    public String getU_introduction() {
        return u_introduction;
    }

    public void setU_introduction(String u_introduction) {
        this.u_introduction = u_introduction;
    }

    public User() {
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return u_id == user.u_id &&
                u_authority == user.u_authority &&
                u_age == user.u_age &&
                Objects.equals(u_name, user.u_name) &&
                Objects.equals(u_pwd, user.u_pwd) &&
                Objects.equals(u_sex, user.u_sex) &&
                Objects.equals(u_location, user.u_location) &&
                Objects.equals(u_img, user.u_img) &&
                Objects.equals(u_introduction, user.u_introduction);
    }

    @Override
    public int hashCode() {
        return Objects.hash(u_id, u_name, u_pwd, u_authority, u_age, u_sex, u_location, u_img, u_introduction);
    }

    @Override
    public String toString() {
        return "User{" +
                "u_id=" + u_id +
                ", u_name='" + u_name + '\'' +
                ", u_pwd='" + u_pwd + '\'' +
                ", u_authority=" + u_authority +
                ", u_age=" + u_age +
                ", u_sex='" + u_sex + '\'' +
                ", u_location='" + u_location + '\'' +
                ", u_img='" + u_img + '\'' +
                ", u_introduction='" + u_introduction + '\'' +
                '}';
    }
}
